# 矩阵碰撞
class box:
    def __init__(self, x=0, y=0, z=0, h=0):
        self.x = x
        self.y = y
        self.width = z  # 更改变量名以反映其实际含义
        self.height = h  # 同样更改变量名

    def collision(self, other_box):
        # 计算两个盒子在 x 和 y 维度上的重叠部分
        overlap_x = min(self.width,other_box.width) - max(self.x,other_box.x)
        overlap_y = min(self.height,other_box.height) - max(self.y,other_box.y)
        # 如果两个维度上都有重叠，则返回重叠的面积
        if overlap_x > 0 and overlap_y > 0:
            return overlap_x * overlap_y
        else:
            # 如果没有重叠，则返回 0
            return 0
n,a,b = input().strip().split()
# print(n,a,b)
bigbox = box(z=int(a),h=int(b))
boxs = []
result = 0
for i in range(int(n)):
    x,y,z,h = input().strip().split()
    tbox = box(int(x),int(y),int(z),int(h))
    result = result + bigbox.collision(tbox)
print(result)

